<?php
session_start();

include "webmaster_connect.php";

$page_permission = 2;

include "webmaster_check_login.php";

$request_id = $_POST['request_id'];

mysql_query("UPDATE customer_sell_requests SET 

request_status = 'Read'

WHERE request_id = $request_id");

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style type="text/css">
body {
	background-image: url(../images/wood.jpg);
	background-repeat: repeat-x;
	margin: 0px;
	background-position: left top;
	background-attachment: fixed;
	background-color: #000000;
	padding-top: 0px;
	padding-right: 0px;
	padding-bottom: 0px;
	padding-left: 0px;
}
</style>
<link href="../css/webmaster_sell_request.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="page_container">

<?php 

include "../admin_files/webmaster_header.php";
include "../admin_files/webmaster_navigation.php" 

?>

<div id="content_container">


<h1>Viewing sell request #<?php echo $_POST['request_id'] ?></h1>

<?php

$query = "SELECT * FROM customer_sell_requests WHERE request_id = $request_id";

$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{

$customer_name = $row['customer_name'];	
$customer_number = $row['customer_number'];	
$customer_email = $row['customer_email'];	
$customer_postcode = $row['customer_postcode'];
$sell_type = $row['sell_type'];
$estimate_price = $row['estimate_price'];	
$saddle_name = $row['saddle_name'];	
$saddle_colour = $row['saddle_colour'];	
$saddle_size = $row['saddle_size'];
$saddle_image_1 = $row['saddle_image_1'];
$saddle_image_2 = $row['saddle_image_2'];
$saddle_image_3 = $row['saddle_image_3'];
$saddle_image_4 = $row['saddle_image_4'];	
$customer_message = $row['customer_message'];	
	
}

?>

<form action="webmaster_process_amend_product.php" method="post" name="add_product" id="add_product">

<h2>Customer details</h2>

<input name="customer_name" type="text" value="<?php echo $customer_name ?>" />
<input name="customer_number" type="text" value="<?php echo $customer_number ?>" />
<input name="customer_email" type="text" value="<?php echo $customer_email ?>" />
<input name="customer_postcode" type="text" value="<?php echo $customer_postcode ?>" />

<h2>Sale details</h2>

<input name="sell_type" type="text" value="<?php echo $sell_type ?>" />
<input name="estimate_price" type="text" value="£<?php echo $estimate_price ?>" />

<h2>Product details</h2>

<input name="product_name" type="text" value = "<?php echo $saddle_name ?>"/>
<input name="product_colour" type="text" value = "<?php echo $saddle_colour ?>"/>
<input name="product_size" type="text" value = "<?php echo $saddle_size ?>"/>

</form>

</div>

<?php if($saddle_image_1 == "" && $saddle_image_2 == "" && $saddle_image_3 == "" && $saddle_image_4 == "") {$class = "hidden";} else {$class="";} ?>

<div id="content_container" class="<?php echo $class ?>">

<h2>Saddle images</h2>

<table width="950" border="0">
  <tr>
    <td>Image 1</td>
    <td>Image 2</td>
    <td>Image 3</td>
    <td>Image 4</td>
  </tr>
  <tr>
    <td><img src="../sell_request_images/<?php echo $saddle_image_1 ?>" width="100" height="100" /></td>
    <td><img src="../sell_request_images/<?php echo $saddle_image_2 ?>" width="100" height="100" /></td>
    <td><img src="../sell_request_images/<?php echo $saddle_image_3 ?>" width="100" height="100" /></td>
    <td><img src="../sell_request_images/<?php echo $saddle_image_4 ?>" width="100" height="100" /></td>
  </tr>
</table>

</div>

<div id="content_container">

<h2>Customer message</h2>

<textarea name="customer_message" cols="" id="customer_message" rows=""><?php echo $customer_message ?></textarea>

<form action="sd" method="post" name="delete_sell_request">
<input name="request_id" type="hidden" value="<?php echo $request_id ?>" />
<input name="delete_request" type="button" value="Delete" />
</form>

</div>
<!--content_container-->

</div> 
<!--page_container-->

</body>
</html>

